
#ifndef CGAMEAPPLICATION_H
#define CGAMEAPPLICATION_H

#include <windows.h>

#include <vector>
#include <string>
#include <math.h>
#include <sstream>
#include <iostream>

#include "boost/smart_ptr.hpp"

#include <GL/gl.h>

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>

#include "Font.h"
#include "Image.h"
#include "Sprite.h"

typedef boost::shared_ptr<Font>  FontPtr;
typedef boost::shared_ptr<Sprite> SpritePtr;
typedef boost::shared_ptr<Image> ImagePtr;

#include "Text.h"

typedef boost::shared_ptr<Text> TextPtr;

#include "Tile.h"

typedef boost::shared_ptr<Tile> TilePtr;

#include "CImageManager.h"
#include "CTextManager.h"
#include "CMapManager.h"
#include "CKeyboardHandler.h"
#include "GameApp.h"

class CGameApplication
{
public:
	static CGameApplication* getInstance();

	void initializeApplication();

	void initializeApplicationVideo(); 
	void initializeApplicationImages(); 
	void initializeApplicationFonts();

	void renderApplication(); 

	void glEnable2D();
	void glDisable2D();

	GameApp *getGameApp() { return GApp ; }
	CTextManager *getCTextManager() { return CTextM; }
	CKeyboardHandler *getCKeyboardHandler() { return CKeyboardH; }
	CImageManager *getCImageManager() { return CImageM; }
	CMapManager *getCMapManager() { return CMapM; }

protected:
	CGameApplication()
	{
		GApp = new GameApp();
		CImageM = new CImageManager();
		CTextM = new CTextManager();
		CKeyboardH = new CKeyboardHandler();
		CMapM = new CMapManager();
	}

private:
	static CGameApplication *pGameInstance;
	GameApp *GApp;
	CImageManager *CImageM; 
	CTextManager *CTextM;
	CMapManager *CMapM;
	CKeyboardHandler *CKeyboardH;
};


#endif